public class demo11 {
        public static void main(String[] args) {
            int []arr={4,55,6,7,8,9,15};
           int[]arrs= num(arr);
        }
        public static int[] num(int[] arr) {
            int max=arr[0];
            int min=arr[0];
            for (int i=0;i<arr.length;i++){
                if (max<arr[i]){
                    max=arr[i];
                }
            }
            for (int i=0;i<arr.length;i++){
                if (min>arr[i]){
                    min=arr[i];
                }
            }
            int[] maxAndMin = {min,max};
            return maxAndMin;
        }
    }

